#!/bin/bash
echo "=== Building with MSYS2 MinGW ==="

cd /d/vc/devops-platform

# Clean previous build
if [ -d "build" ]; then
    echo "Cleaning previous build..."
    rm -rf build
fi

mkdir build
cd build

echo "1. Running CMake configuration..."
cmake .. -G "MinGW Makefiles" -DCMAKE_BUILD_TYPE=Release

echo "2. Building project..."
make -j4

if [ $? -eq 0 ]; then
    echo "[SUCCESS] Build completed! Executable: ./devops-platform.exe"
else
    echo "[ERROR] Build failed!"
    exit 1
fi
